﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Procenge.PortalVendas.Models.Pedido>" %>
<%@ Import Namespace="Procenge.PortalVendas.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <form id="form1" runat="server">

    <h2>Create</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.codCompra) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.codCompra) %>
                <%: Html.ValidationMessageFor(model => model.codCompra) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.codProduto) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.codProduto) %>
                <%: Html.ValidationMessageFor(model => model.codProduto) %>

                <asp:ListBox ID="ListBox1" runat="server" DataSourceID="MOR" 
                    DataTextField="codigo" DataValueField="nome">
                
                </asp:ListBox>
                <asp:LinqDataSource ID="MOR" runat="server" 
                    ContextTypeName="Procenge.PortalVendas.Models.MORDataContext" EntityTypeName="" 
                    GroupBy="codigo" OrderBy="nome" OrderGroupsBy="key" 
                    Select="new (key as codigo, it as nome)" TableName="Produtos">
                </asp:LinqDataSource>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.item) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.item) %>
                <%: Html.ValidationMessageFor(model => model.item) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.qtd) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.qtd) %>
                <%: Html.ValidationMessageFor(model => model.qtd) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.valor) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.valor) %>
                <%: Html.ValidationMessageFor(model => model.valor) %>
            </div>


            
            <p>
                &nbsp;<input type="submit" value="Create" style="text-align: center" /></p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

    </form>

</asp:Content>

